package com.cn.domain;

import java.io.Serializable;

/**
 * 商品详情
 */
public class Product implements Serializable{

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private long       hp_id;             //商品ID
    private String    hp_name;             //商品名称
    private String    hp_description;          //商品描述
    private double   hp_price;                  //商品价格
    private int         hp_stock;                    //库存
    private int         hpc_id;                     //父类ID
    private int         hpc_child_id;        //子类ID
    private String    hp_file_name;   //图片路径
    private Category           cate;             //类型    外键

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((cate == null) ? 0 : cate.hashCode());
		result = prime * result + ((hp_description == null) ? 0 : hp_description.hashCode());
		result = prime * result + ((hp_file_name == null) ? 0 : hp_file_name.hashCode());
		result = prime * result + (int) (hp_id ^ (hp_id >>> 32));
		result = prime * result + ((hp_name == null) ? 0 : hp_name.hashCode());
		long temp;
		temp = Double.doubleToLongBits(hp_price);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + hp_stock;
		result = prime * result + hpc_child_id;
		result = prime * result + hpc_id;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Product other = (Product) obj;
		if (cate == null) {
			if (other.cate != null)
				return false;
		} else if (!cate.equals(other.cate))
			return false;
		if (hp_description == null) {
			if (other.hp_description != null)
				return false;
		} else if (!hp_description.equals(other.hp_description))
			return false;
		if (hp_file_name == null) {
			if (other.hp_file_name != null)
				return false;
		} else if (!hp_file_name.equals(other.hp_file_name))
			return false;
		if (hp_id != other.hp_id)
			return false;
		if (hp_name == null) {
			if (other.hp_name != null)
				return false;
		} else if (!hp_name.equals(other.hp_name))
			return false;
		if (Double.doubleToLongBits(hp_price) != Double.doubleToLongBits(other.hp_price))
			return false;
		if (hp_stock != other.hp_stock)
			return false;
		if (hpc_child_id != other.hpc_child_id)
			return false;
		if (hpc_id != other.hpc_id)
			return false;
		return true;
	}

	public long getHp_id() {
        return hp_id;
    }

    public void setHp_id(long hp_id) {
        this.hp_id = hp_id;
    }

    public String getHp_name() {
        return hp_name;
    }

    public void setHp_name(String hp_name) {
        this.hp_name = hp_name;
    }

    public String getHp_description() {
        return hp_description;
    }

    public void setHp_description(String hp_description) {
        this.hp_description = hp_description;
    }

    public double getHp_price() {
        return hp_price;
    }

    public void setHp_price(double hp_price) {
        this.hp_price = hp_price;
    }

    public int getHp_stock() {
        return hp_stock;
    }

    public void setHp_stock(int hp_stock) {
        this.hp_stock = hp_stock;
    }

    public int getHpc_id() {
        return hpc_id;
    }

    public void setHpc_id(int hpc_id) {
        this.hpc_id = hpc_id;
    }

    public int getHpc_child_id() {
        return hpc_child_id;
    }

    public void setHpc_child_id(int hpc_child_id) {
        this.hpc_child_id = hpc_child_id;
    }

    public String getHp_file_name() {
        return hp_file_name;
    }

    public void setHp_file_name(String hp_file_name) {
        this.hp_file_name = hp_file_name;
    }

    public Category getCate() {
        return cate;
    }

    public void setCate(Category cate) {
        this.cate = cate;
    }

    @Override
    public String toString() {
        return "Product{" +
                "hp_id=" + hp_id +
                ", hp_name='" + hp_name + '\'' +
                ", hp_description='" + hp_description + '\'' +
                ", hp_price=" + hp_price +
                ", hp_stock=" + hp_stock +
                ", hpc_id=" + hpc_id +
                ", hpc_child_id=" + hpc_child_id +
                ", hp_file_name='" + hp_file_name + '\'' +
                ", cate=" + cate +
                '}';
    }
}
